﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;


namespace FXnaEngine.Physics
{
    /// <summary>
    /// Interface for all physics scenes.
    /// </summary>
    public interface IPhysicsScene : IDisposable
    {
        /// <summary>
        /// Gets/sets the gravity vector.
        /// </summary>
        Vector3 Gravity { get; set; }

        /// <summary>
        /// Creates a new physics actor.
        /// </summary>
        /// <param name="desc">The <see cref="ActorDesc"/> describing the actor.</param>
        /// <returns>Instance of new physics actor.</returns>
        IPhysicsActor CreateActor(ActorDesc desc);

        void SetPhysicsTimeStep(int stepsPerSecond);

        /// <summary>
        /// Schedules an actor to be deleted and removed from the physics scene before the next simulation step.
        /// </summary>
        /// <param name="actor"><see cref="IPhysicsActor"/> to remove.</param>
        void ScheduleForDeletion(IPhysicsActor actor);

        /// <summary>
        /// Begins processing a physics simulation frame.
        /// </summary>
        /// <param name="gameTime">The elapsed time since the last update.</param>
        bool BeginFrame(GameTime gameTime);

        /// <summary>
        /// Blocks until the currently processing physics frame is complete.
        /// </summary>
        bool EndFrame();

        /// <summary>
        /// Kills the physics processing thread.
        /// </summary>
        void KillProcessingThread();
    }
}
